package com.tmz.cloudmall.cloudmallorder.service.impl;

import java.util.List;

import com.tmz.cloudmall.cloudmallcommon.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tmz.cloudmall.cloudmallorder.mapper.OperateHistoryMapper;
import com.tmz.cloudmall.cloudmallorder.domain.OperateHistory;
import com.tmz.cloudmall.cloudmallorder.service.IOperateHistoryService;

/**
 * 订单操作历史Service业务层处理
 * 
 * @author tmz
 * @date 2025-08-16
 */
@Service
public class OperateHistoryServiceImpl implements IOperateHistoryService 
{
    @Autowired
    private OperateHistoryMapper operateHistoryMapper;

    /**
     * 查询订单操作历史
     * 
     * @param id 订单操作历史主键
     * @return 订单操作历史
     */
    @Override
    public OperateHistory selectOperateHistoryById(Long id)
    {
        return operateHistoryMapper.selectOperateHistoryById(id);
    }

    /**
     * 查询订单操作历史列表
     * 
     * @param operateHistory 订单操作历史
     * @return 订单操作历史
     */
    @Override
    public List<OperateHistory> selectOperateHistoryList(OperateHistory operateHistory)
    {
        return operateHistoryMapper.selectOperateHistoryList(operateHistory);
    }

    /**
     * 新增订单操作历史
     * 
     * @param operateHistory 订单操作历史
     * @return 结果
     */
    @Override
    public int insertOperateHistory(OperateHistory operateHistory)
    {
        operateHistory.setCreateTime(DateUtils.getNowDate());
        return operateHistoryMapper.insertOperateHistory(operateHistory);
    }

    /**
     * 修改订单操作历史
     * 
     * @param operateHistory 订单操作历史
     * @return 结果
     */
    @Override
    public int updateOperateHistory(OperateHistory operateHistory)
    {
        return operateHistoryMapper.updateOperateHistory(operateHistory);
    }

    /**
     * 批量删除订单操作历史
     * 
     * @param ids 需要删除的订单操作历史主键
     * @return 结果
     */
    @Override
    public int deleteOperateHistoryByIds(Long[] ids)
    {
        return operateHistoryMapper.deleteOperateHistoryByIds(ids);
    }

    /**
     * 删除订单操作历史信息
     * 
     * @param id 订单操作历史主键
     * @return 结果
     */
    @Override
    public int deleteOperateHistoryById(Long id)
    {
        return operateHistoryMapper.deleteOperateHistoryById(id);
    }
}
